package com.mf.ergate.api.opt;

import com.mf.ergate.api.ApiConfig;
import com.mf.ergate.api.opt.model.dto.OrgContractCreateDto;
import com.mf.ergate.api.opt.model.dto.OrgContractDeleteDto;
import com.mf.ergate.api.opt.model.dto.OrgContractQueryDto;
import com.mf.ergate.api.opt.model.dto.OrgContractUpdateDto;
import com.mf.ergate.api.opt.model.vo.OrgContractVo;
import com.mf.framework.common.model.Page;
import com.mf.framework.common.model.RemotePage;
import com.mf.framework.common.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 机构合同RemoteService层接口类
 * User: zhaoming
 * DateTime: 2019-04-16
 * To change this template use File | Settings | File Templates.
 **/
@Api(value = "/api/orgContract", tags = "OrgContractController", description = "机构合同服务")
@FeignClient(name= ApiConfig.SERVICE_NAME)
@RequestMapping("/api/orgContract")
public interface OrgContractRemoteService {

    /**
     * 新增
     * @param contractInfoCreateDto 机构合同新增Dto
     * @return 机构合同
     */
    @ApiOperation(value = "新增")
    @ApiImplicitParam(name = "contractInfoCreateDto", value = "机构合同新增Dto", dataType = "ContractInfoCreateDto",  required = true, paramType = "body")
    @RequestMapping(value = "/insert", method = RequestMethod.POST)
    Result<OrgContractVo> insert(@RequestBody OrgContractCreateDto contractInfoCreateDto);

    /**
     * 根据唯一编号更新
     * @param contractInfoUpdateDto 机构合同更新Dto
     * @return 执行结果
     */
    @ApiOperation(value = "根据唯一编号更新")
    @ApiImplicitParam(name = "contractInfoUpdateDto", value = "机构合同更新Dto", dataType = "ContractInfoUpdateDto",  required = true, paramType = "body")
    @RequestMapping(value = "/updateByUniqueNo", method = RequestMethod.POST)
    Result<Boolean> updateByUniqueNo(@RequestBody OrgContractUpdateDto contractInfoUpdateDto);

    /**
     * 根据唯一编号删除(逻辑删除)
     * @param contractInfoDeleteDto 机构合同删除Dto
     * @return 执行结果
     */
    @ApiOperation(value = "根据唯一编号删除(逻辑删除)")
    @ApiImplicitParam(name = "contractInfoDeleteDto", value = "机构合同删除Dto", dataType = "ContractInfoDeleteDto",  required = true, paramType = "body")
    @RequestMapping(value = "/deleteByUniqueNo", method = RequestMethod.POST)
    Result<Boolean> deleteByUniqueNo(@RequestBody OrgContractDeleteDto contractInfoDeleteDto);

    /**
     * 根据唯一编号查询
     * @param uniqueNo 唯一编号
     * @return 机构合同
     */
    @ApiOperation(value = "根据唯一编号查询")
    @ApiImplicitParam(name = "uniqueNo", value = "唯一编号", dataType = "String",  required = true, paramType = "body")
    @RequestMapping(value = "/selectByUniqueNo", method = RequestMethod.POST)
    Result<OrgContractVo> selectByUniqueNo(@RequestBody String uniqueNo);

    /**
     * 根据条件查询
     * @param contractInfoQueryDto 机构合同查询Dto
     * @return 机构合同列表
     */
    @ApiOperation(value = "根据条件查询")
    @ApiImplicitParam(name = "contractInfoQueryDto", value = "机构合同查询Dto", dataType = "ContractInfoQueryDto",  required = true, paramType = "body")
    @RequestMapping(value = "/selectByCondition", method = RequestMethod.POST)
    Result<List<OrgContractVo>> selectByCondition(@RequestBody OrgContractQueryDto contractInfoQueryDto);

    /**
     * 根据条件查询数量
     * @param contractInfoQueryDto 机构合同查询Dto
     * @return 数量
     */
    @ApiOperation(value = "根据条件查询数量")
    @ApiImplicitParam(name = "contractInfoQueryDto", value = "机构合同查询Dto", dataType = "ContractInfoQueryDto",  required = true, paramType = "body")
    @RequestMapping(value = "/selectCount", method = {RequestMethod.POST})
    Result<Integer> selectCount(@RequestBody OrgContractQueryDto contractInfoQueryDto);

    /**
     * 根据条件分页查询
     * @param remotePage 远程分页
     * @return 机构合同分页列表
     */
    @ApiOperation(value = "根据条件分页查询")
    @ApiImplicitParam(name = "remotePage", value = "远程分页", dataType = "RemotePage",  required = true, paramType = "body")
    @RequestMapping(value = "/selectPage", method = {RequestMethod.POST})
    Result<Page<OrgContractVo>> selectPage(@RequestBody RemotePage<OrgContractQueryDto> remotePage);
}
